package neu.soft.vendormock.listener;

import lombok.extern.slf4j.Slf4j;
import neu.soft.vendormock.service.SupplyMockService;
import neu.soft.vo.MsgBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class SupplySendListener {

    @Autowired
    SupplyMockService supplyMockService;

    @StreamListener("mock-supply-input")
    public void sendGoodInfo(@Payload MsgBean<Integer> msgBean) {
        Integer operationId = msgBean.getData();
        supplyMockService.sengGoods(operationId);
    }
}
